package com.soft.bams.entity;/**
 * @desc  TODO
 * @author wangshaoshuai
 * @date   2025/4/21
 */
public abstract class Account {


    private Long id;
    private String password;
    private String name;
    private String personId;
    private String email;
    private double balance;

    public Account() {
    }

    public Account(String password, String name, String personId, String email, double balance) {
        this.password = password;
        this.name = name;
        this.personId = personId;
        this.email = email;
        this.balance = balance;
    }

    public Account(Long id, String password, String name, String personId, String email, double balance) {
        this.id = id;
        this.password = password;
        this.name = name;
        this.personId = personId;
        this.email = email;
        this.balance = balance;
    }

    /**
     * 获取
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取
     * @return password
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return personId
     */
    public String getPersonId() {
        return personId;
    }

    /**
     * 设置
     * @param personId
     */
    public void setPersonId(String personId) {
        this.personId = personId;
    }

    /**
     * 获取
     * @return email
     */
    public String getEmail() {
        return email;
    }

    /**
     * 设置
     * @param email
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * 获取
     * @return balance
     */
    public double getBalance() {
        return balance;
    }

    /**
     * 设置
     * @param balance
     */
    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String toString() {
        return "Account{id = " + id + ", password = " + password + ", name = " + name + ", personId = " + personId + ", email = " + email + ", balance = " + balance + "}";
    }

    /**
     * 存款
     * @param money  钱
     * @return 返回银行卡本身
     */
    public final Account deposit(double money){
        this.balance+=money;
        //this 当前正在使用的对象
        return this;
    }

    /**
     * 取款
     * @param money  钱
     * @return  返回银行卡本身
     */
    public abstract Account withdraw(double money);

}
